﻿using System;
using Microsoft.SharePoint.Taxonomy;

namespace SPContrib.SharePoint.Taxonomy.Extensions
{
    public static class TaxonomyFieldExtensions
    {
        public static void ConnectWithTermSet(this TaxonomyField instance, TermSet termset)
        {
            instance.SspId = termset.TermStore.Id;
            instance.TermSetId = termset.Id;
            instance.TargetTemplate = string.Empty;
            instance.AnchorId = Guid.Empty;
            instance.Update();
        }
    }
}
